///@ait_only
/** @file config_fw.h

All customer-dependent compiler options go here.
The purpose is to prepare many versions of the file to different use cases,
such as different customers and different platforms. When compiling, simply replace this file and then compile the whole project.
This file could be used both in firmware projects.

This file should not be included in includes_fw.h.
Because the file is used to config and recompile the whole project,
it's better to be used only in the file which needs the config.
And it's highly recommended to use a value in the \#define instead of \#define only. That is
@code #define DOWNLOAD_METHOD 0 @endcode
is better than
@code #define USE_SD_DOWNLOAD_FW @endcode \n
Since the .c files might not include this file and get an unexpected result with any compiler warning.

@brief Configuration compiler options
@author Truman Yang
@since 10-aug-06
@version
- 1.0 Original version
*/


#ifndef _CONFIG_FW_H_
#define _CONFIG_FW_H_
#define ZDW_BARCODE
//#define ZDW_BARCODE_DEBUG
#define ZDW_BARCODE_POWER_ON_WORKING
#define ZDW_SET_EXPOSURE
//#define TEST_FOR_PRODUCTION
//#define ZDW_BARCODE_BTN_USER_MODE
//#define ZDW_TEST_MODE
#define DYNAMIC_CONFIG_CACHEBUF 1
    // Enable watch dog reset
    #define WATCHDOG_RESET_EN   (0)

    //#define SOF_USB_PHY_CHECK   (1)
    
 	#define EXT_PMCLK_CKL       12000   
 	
    /** @name System **/
    #define BOOT_4K_ITCM            (1)
    #if BOOT_4K_ITCM==1
    //#define USB_POWER_EN          (0) // power on USB in firmware, not in boot code
    #define AIT_BOOTCODE_FLASH_ADDR     (0x00000000)
    #define AIT_BOOTCODE_FLASH_SIZE     (0xA000) // total boot code size
    //#if CHIP_VER == VER_A
    #define AIT_BC1_FLASH_SIZE          (0x1000) // boot code 1 in ITCM
    #define AIT_FW_FLASH_ADDR           (0xA000) //32K start
    #else
    #define USB_POWER_EN            (1) // power on usb in firmware, not in bootcode
    #endif

    #define SIF_BUFFER_START  	(0x010F0000)  //0x110000	//Temp Buf, size:0x1000
    #define CALI_BUFFER_START   (0x010F1000)  //start of the calibration data. up to IQ_TABLE_MAX_SIZE is needed.
    #define FW_DOWNLOAD_BUFFER  (0x01100000)  //1. used for FW data from XU.   2. IQ table from flash, up to IQ_TABLE_MAX_SIZE

    #if defined(MBOOT_FW)||defined(UPDATER_FW)

    extern unsigned int glCPUFreq;
    #define RTNA_CLK_M                  (glCPUFreq/1000)

    #define RTNA_CPU_CLK_M              (RTNA_CLK_M/1)
    #endif
    //
    // 0x0D -> Rx Sensitivity
    // 0x0F -> The size of eye
    //
                                             // [7]: 0: fast slew rate, 1: slow slew rate for EMI issue
                                             // History settings: 0x0D17 0x0D0F 0x0D17 0x0A37
    #define USB_SQUELCH_LEVEL      (0x0D77)  //Ryan suggest change from 440mV to 420mV
    //Tx_Max(Rx08):450mV=0x37     Rx_Min(Rx09):75mV=0x08
    /*
    //#define CPU_166     (0)
    //#define CPU_216     (1)
    //#define CPU_300     (2)
    //#define CPU_192     (3)
        
    //#define CPU_216_G0_216  (0)  // CPU: 216MHz, G0: 216MHz
    //#define CPU_300_G0_192  (1)  // CPU: 300MHz, G0: 192MHz

    //#define G0_CLK      (144000)  // 192000, 144000, 120000, 96000
    //#define CPU_MHZ     (CPU_300)

    //#define G1_CLK      (96000)   // 192000, 144000, 120000, 96000

    //#define H264_BASELINE_PROFILE 1
    //#define H264_HIGH_PROFILE 2

    //#define H264_PROFILE H264_HIGH_PROFILE
    //#define H264_PROFILE H264_BASELINE_PROFILE

    //#define TURN_ON_WOV_BY_DEFAULT (0)
    //#define ENABLE_SKIP_FRAME_FOR_CROP (0)
    //#define ENABLE_SKYPE_15_30_FPS (0)

    //#define VREF_CAPACITOR_UF   (1)        // ext capacitor for VREF
    //#define ANA_PDN_DLY_MS      (1)
    //#define ADC_PGA_PDN_DLY_MS  (10*VREF_CAPACITOR_UF)
    
    //#define NORMAL_REL          (0)
    //#define JTAGDBG_REL         (1)
    
    //#define FW_RELEASE_TARGET   NORMAL_REL   //JTAGDBG_REL
    */
    #define JTAG_DBG_EN         (0)
    #define UART_DBG_EN         (1) // Enable UART debug message
    #if JTAG_DBG_EN==0
    #define HEARTBEAT_LED_EN    (0) // if GPIO-8(8423) connect a LED in AIT EV - board. (need to check ) 
    #define JTAG  (0)
    #else
    #define HEARTBEAT_LED_EN    (0)
    #define JTAG  (1)
    #endif
    /// Debug Level: see @ref debug_level for more detail.
#ifdef ZDW_BARCODE
    #define DBG_LEVEL (4)
#else
	 #define DBG_LEVEL (3)
#endif
    /** @brief Define if version B code is compiled. */

    #define	P_V2		(1)
    #define	VSN_V2		(2)
    #define	VSN_V3		(3)

    #define	VER_A	(0)
    #define	VER_B	(1)
    #define	VER_C	(2)
    /** end of System **/

#if 0
    #define DEMOKIT  (1)
    #define ADAGIO   (2)	
    #define PRESTIGE (3)
    #define STAGE    (4)
    #define PURE     (5)	
    #define HELIUM   (6)		
    #define PROJECT     (DEMOKIT)
#endif
    #define KYE       (1)
    #define BIS       (2)
    #define AZW       (3)
    #define SAL       (4)
    #define LGT       (5)
    #define DMX       (6)
    #define FCN       (7)
    #define BIS_5M    (8)
    #define SEM       (9)
    #define LON       (10)
    #define STK       (11)
    #define NMG       (12)
    #define CCN       (13)
    #define SAC       (14)
    #define LIT       (15)
    #define NKT       (16)
    #define SNO       (17)
    #define ASU       (18)
    #define PNS       (19)
    #define CPL       (20)  //compal
    #define QDR       (21)
    #define IPC       (22)  //for IPCam projects
    #define ANW       (23)
    #define CUSTOMER    (IPC)

    #define PYTHON_ECO  (0)

    #define MODEL     (1)   // CCN 0: WM8737, 1: CX20778, 2: OV5680
                            // LGT 0: WM8737, 1: CX20778, 2: OV5680, 3: OV5650
                            // LON 0: OV5680
                            // SNO 0: OV9712/9710(parallel), 1: OV9726+WM8737, 2:OV2722, 3:OV9726(parallel)
                            // ASU 0: EVB, 1:TX20 OV9726(parallel)/OV5647, 2: TX30 OV9726(parallel) only,
                            // PNS 0: EVB, 1:OV9726 + ADC3101
                            // CPL 0: EVB, 1:OV9726
                            // QDR 0: EVB,
                            // IPC 0: EVB,

    #define CHIP_AIT8451    1   //0:AIT8433     1:AIT8451
    #define VENDOR_ID       0x114D
#if CHIP_AIT8451
    #define PID             0x8451
#else
    #define PID             0x8433
#endif

    #ifndef CHIP_VER
        #define	CHIP_VER	(VER_B)    // VER_A: without ROM boot, VER_B: with ROM boot
    #endif

    #define DRAM_SIZE (2) //DRAM size in MB

#if (CUSTOMER == QDR)
    #define MotionDetection  1  //Support MT9D111,HM1375,AR0330,AR0832E,OV9712
#else
    #define MotionDetection  0
#endif
    #define Y_DATA_EN        0//0      // Y_DATA_EN/RAW_DATA_EN only support one
    #define RAW_DATA_EN      0//1      // for aitMD use
    #define SUPPORT_PU_DEFAULT  0

#if Y_DATA_EN || RAW_DATA_EN
    #define SUPPORT_AIT845x_MD  1
#else
    #define SUPPORT_AIT845x_MD  0
#endif
    #define SUPPORT_PIPE_Y      0//1   //for RAW_DATA_EN

    #define SUPPORT_H264MV_MD   (0)

    #define SUPPORT_PWM         1
    #define SUPPORT_HID_FUNC   1   // 0: Disable HID, 1: Enable HID
	#define UART_RXINT_MODE_EN	1

    /** @name System Audio **/
    #define I2S_OUT_EN 					(0) //Wilson: for VSN_V3
    // definition for MIC IN path
    #define MicInPathAFE                (1)
    #define MicInPathI2S                (2)
    #define MicSource                   (MicInPathI2S) //V06 : default is I2S

    #define SUPPORT_UAC                 (0)
    #define USB_UAC_TO_QUEUE            (1)

    #if (MicSource==MicInPathI2S)
    #define AUDIN_CHANNEL               2
    #define AUDIN_SAMPLERATE            16000 // V06 : change to 32000 for default,// 16000
    #else
    #define AUDIN_CHANNEL               2	// sean@2010_08_12 for stereo test
    #define AUDIN_SAMPLERATE            32000
    #endif

    #define MAX_AUDIN_SAMPLE_PER_MS (AUDIN_SAMPLERATE/1000)//this defines the max AUD-IN buffer size.
                                                           //in 8451 it was in SRAM and now move it to cached code array.

    #define NO_DAC                      0
    #define AIC3254                     0x3254
    #define ADC3101                     0x3101
    #define CX20709                     0x20709
    #define CX20778                     0x20778
    #define DA7211						0x7211
    #define WM8737                      0x8737
    #define WM8750                      0x8750
    #define WM8960                      0x8960
    #define WM8973                      0x8973
    #define CODEC_VT1602        (0)
    #if (MicSource==MicInPathI2S)
    #if ((CUSTOMER == CCN)&&(MODEL == 0)) || ((CUSTOMER == LGT) && (MODEL == 0))
    #elif ((CUSTOMER == PNS) && ((MODEL == 1) || (SUPPORT_UAC)))
        #define AUDEXT_DAC                  ADC3101
    #elif ((CUSTOMER == CCN)&&(MODEL == 1)) || ((CUSTOMER == LGT) && (MODEL == 1))	
        #define AUDEXT_DAC                  CX20778
    #else
        #define AUDEXT_DAC                  CX20709
    #endif	
    #else
    #define AUDEXT_DAC                  NO_DAC
    #endif
    //Wilson@120830 for UAC sync
    #define UAC_TIMER_MS_LENGTH			450 //450 uS

	#define SUPPORT_AGC                 (0)
    #define SUPPORT_AUDIO_PROCESSING_TASK    (1)  // support audio processing task for customer's algorithm
    //build 2 versions for PNS before 9/27 release.
    #define UAC_SYNC_MODE_EN            (0) //UAC & A.CODEC sync mode. 0:Off  1:SW.SRC method 2:I2S_MCLK
    #define AUDIO_LATENCY               (1)//test Audio latency
    /** end of System Audio **/

    #define TRUNK_BCD                   (0x1127)// Date code for the trunk version
                                                //It is also the build number of firmware version.
    #define SUB_DAY_VERSION             (0)		//Because it's date code as build code. (10K * SUB_DATE_VERSION) will add
                                                //into build number. e.g. build 0820 will become 10821. It could be used to
                                                //distinguish which version of the build.
                                                //This number should reset to 0 if TRUNK_BCD changes.
                                                //This number should used while doing EXTERNAL RELEASE.
                                                //Internal check in does not need to add this number.

    #define FW_VER_BCD                  TRUNK_BCD  // for USB BCDdevice version        

    /*#define SENSOR_SXGA_CROPPING_HD     (0)        // only for sensor cropping issue
    #define PCCAM_VIDEO_COMPRESS_BUF    (0x01800000)*/

#if (CUSTOMER == LON) || ((CUSTOMER == CCN)&&(MODEL == 2)) || ((CUSTOMER == LGT)&&(MODEL == 3)) || (CUSTOMER == ASU)
    #define SUPPORT_AUTO_FOCUS          (1)
#else
    #define SUPPORT_AUTO_FOCUS          (0)
#endif
    #define SUPPORT_DIGITAL_ZOOM        (1)
    #define SUPPORT_DIGITAL_PAN         (1)
#if ((CUSTOMER == ASU)&&(MODEL == 1))
    #define SUPPORT_DUAL_DEVICE         (0)//dual UVC, 2 IAD in one descriptor
    #define SUPPORT_SWITCH_CAMERA       (1)//one UVC device but switch sensor by XU (MMP 0xA1), contrary to (SUPPORT_DUAL_DEVICE)
#else
    #define SUPPORT_DUAL_DEVICE         (0)
    #define SUPPORT_SWITCH_CAMERA       (0)
#endif
#if ((SUPPORT_DUAL_DEVICE==1) && (SUPPORT_SWITCH_CAMERA==1))
    #error: 2 exclusive options!
#endif

#if (CUSTOMER == LON) || ((CUSTOMER == CCN)&&(MODEL == 2))
    #define SUPPORT_FLASH_LIGHT         (1)
#else    
    #define SUPPORT_FLASH_LIGHT         (0)
#endif    
    
    //#define H264_LOW_BITRATE_TEST       (1)
    
    #define SKYPE_H264_TEST             (0)  // 1: VGA H264, 0: HD H264
    //#define DEFAULT_VIDEO_FMT_H264      (0)  // 0: YUV/MJPEG, 1: H.264
    
    //#define LCD_DISPLAY_ON              (0) //Truman@121031 move to includes_fw.h. Since it won't be config on this chip.
                                               // and leave the MMPF layer to RD team.
    // sean@2010_12_08 deleted
    //#define CPU_G1_G2_DRAM_CLK          (144)  // define CPU, G0, G2, DRAM clock, 144MHz or 132MHz
    //#define G0_CLK                      (144)  // define Group 0 clock, 144MHz, 132MHz, 120MHz, 108MHz

    #define ENABLE_JPEG_ISR             (1)
    #define ENABLE_YUV_ISR              (1)
    
    #define SPEED_UP_PREVIEW_FRAME_RATE     (1)  // 1: speed up YUY2 VGA to 30fps
    
#if (CUSTOMER == FCN)
    #define CAPTURE_FULL_SCALE          (0)
#else
    #define CAPTURE_FULL_SCALE          (0)
#endif    

    //#define BIT_RATE_OPTION_FOR_FULL_SPEED        (1)    // 1: bit rate option for USB full speed
    //#define SW_TEST                               (1)

    //#define SUPPORT_HARDWARE_SNAP_BUTTON       (0)   // must be 1 for win7 suspend issue, tomy@2010_05_31

    #define SKYPE_FOV                   (1)    // for Skype video FOV specification
    
    #define CAPTURE_BAYER_RAW_ENABLE    (0)
    #define CAPTURE_RAW_XU              (0)    // set 1 to enable special XU command so that any MJEPG could output final RAW data.
                                               // raw data could be YUY2 or RAW8 RAW10
    #define RAW_PROC_10_BIT_EN          (0)    // 0: 8 bits Bayer raw, 1: 10 bits Bayer raw

#if (CUSTOMER == ASU)
    #define SUPPORT_ISP_ENGINEERING_MODE_FUNCTION (1)
    #define SUPPORT_ISP_CALIBRATION_FUNCTION (1)
#else
    #define SUPPORT_ISP_ENGINEERING_MODE_FUNCTION (0)
    #define SUPPORT_ISP_CALIBRATION_FUNCTION (0)
#endif

#ifdef ZDW_BARCODE //CUSTOMER == PNS
    #define CUSTOMER_DATA_SIZE_IN_FLASH (0x100)  //customer data size, this should be arranged from the end of flash.
	                                              //Note that the 4K blocks used for customer data could not be used for other purpose
    #define MAX_FLASH_SIZE              (512*1024) //this size is used for customer data size only.
#else
    #define CUSTOMER_DATA_SIZE_IN_FLASH (0x1000)
    #define MAX_FLASH_SIZE              (256*1024) //this size is used for customer data size only.
#endif

#if (CUSTOMER == PNS) && (MODEL == 1)
    #define FW_UPDATE_MODE FW_UPDATE_SINGLE
#else
    #define FW_UPDATE_MODE FW_UPDATE_SINGLE
#endif
        #define FW_UPDATE_SINGLE      (1) //1 PCAM, followed by BC, even if the flash is big enough.
        #define FW_UPDATE_FACTORY     (2) //2 PCAM, PCAM1 follows BC, PCAM2 follows PCAM1.
                                          //  Always update PCAM2.
                                          //  Use 1 PCAM if the flash size is not enough.
        #define FW_UPDATE_PING_PONG   (3) //2 PCAM, PCAM1 follows BC, PCAM2 requires a special location.
                                          //  Update PCAM2(empty) then PCAM1(older, overwrite it), PCAM2(older, overwrite it).
                                          //  Use 1 PCAM if the flash size is not enough.

    // New definition for IQ table separate in flash
    // Be careful! Because of 8433 RAM limitation, if (IQ_TABLE_LOAD_FROM_FLASH==0) && (SUPPORT_DUAL_DEVICE==1), only one IQ table! (Sensor_IQ_CompressedText)
#if (SUPPORT_DUAL_DEVICE) || (SUPPORT_SWITCH_CAMERA)
    #define IQ_TABLE_LOAD_FROM_FLASH    (1)
    #define IQ_TABLE_ADDR_IN_FLASH      (0x7D000)
    #define IQ_TABLE_MAX_SIZE           (0x3000)//isp_8451_iq_data_v2_OV9726.xls.ciq.bin increase to 8.18KB, so increase to 12KB
    #define IQ_TABLE2_ADDR_IN_FLASH     (0x7A000)
#else
    #define IQ_TABLE_LOAD_FROM_FLASH    (0)
    #define IQ_TABLE_ADDR_IN_FLASH      (0x3C000)
    #define IQ_TABLE_MAX_SIZE           (0x4000)
#endif

    #define IQ_CALI_END_ADDR_IN_FLASH   (IQ_TABLE_ADDR_IN_FLASH - (IQ_TABLE_MAX_SIZE * (SUPPORT_DUAL_DEVICE || SUPPORT_SWITCH_CAMERA)))
#if SUPPORT_ISP_CALIBRATION_FUNCTION
    #define IQ_CALI_MAX_SIZE            (0x2000) //tune this later for 8433. (1776 bytes * 3 sets) + headers(32Bytes + 20 bytes * 4 sets)
    #define IQ_CALI_1_ADDR_IN_FLASH     (IQ_CALI_END_ADDR_IN_FLASH - IQ_CALI_MAX_SIZE)
    #define IQ_CALI_2_ADDR_IN_FLASH     (IQ_CALI_1_ADDR_IN_FLASH - IQ_CALI_MAX_SIZE)
#else
    #define IQ_CALI_MAX_SIZE            (0)
    #define IQ_CALI_1_ADDR_IN_FLASH     (0)
    #define IQ_CALI_2_ADDR_IN_FLASH     (0)
#endif

#if (CUSTOMER == NMG)
    #define IQ_SETTING_LOAD_FROM_FLASH  (1)
#else
    #define IQ_SETTING_LOAD_FROM_FLASH  (0)
#endif
    #define IQ_SETTING_ADDR_IN_FLASH    (0x3F000)
    #define IQ_SETTING_MAX_SIZE         (0x1000)
    #define BANDFILTER_OFFSET           (0)

#if (CUSTOMER == CCN) || (CUSTOMER == LON) || (CUSTOMER == ASU)
    #define UVC_SETTING_LOAD_FROM_FLASH  (1)
    #define CUSTOMER_INIT_FLASH_ADDR   IQ_SETTING_ADDR_IN_FLASH 
    #define CUSTOMER_INIT_FLASH_SIZE   (0x1000)
    #define EN_DBGLOG_FOR_FLASH 0//set 0 to reduce flash access time, especially for reducing serial number access time
#else
    #define UVC_SETTING_LOAD_FROM_FLASH  (0)
    #define EN_DBGLOG_FOR_FLASH 1//set 0 to reduce flash access time, especially for reducing serial number access time
#endif	

    #define SUPPORT_SKYPE_OLD_HEADER    (0)    // 1: support Skype 20 byte old header, 0: 32 bytes new header

    #define RAW_PREVIEW_ENABLE                (0)
    #define RAW_PREVIEW_USING_YUY2_PAYLOAD    (0)
    #define RAW_PREVIEW_USING_MJPEG_PAYLOAD   (1)

    #define FLICKER_50HZ                (1)
    #define FLICKER_60HZ                (2)
    #define FLICKER_AUTO                (3)
#if ((CUSTOMER == CCN)&&(MODEL == 1))
    #define DEFAULT_FLICKER_MODE        (FLICKER_50HZ)
#elif (CUSTOMER == PNS)
    #define DEFAULT_FLICKER_MODE        (FLICKER_AUTO)
#else
    #define DEFAULT_FLICKER_MODE        (FLICKER_60HZ)
#endif    

#if (CUSTOMER == LIT) && (AUDEXT_DAC == CX20709)
    #define SUPPORT_CNXT_FW_DOWNLOADING_EEPROM     (1)  // 1: support CX2070x FW downloading to EEPROM
    #define SUPPORT_CNXT_FW_DOWNLOADING_RAM        (0)  // 1: support CX2070x FW downloading to SRAM directly
#elif (CUSTOMER == CCN) && (AUDEXT_DAC == CX20778)
    #define SUPPORT_CNXT_FW_DOWNLOADING_EEPROM     (1)  // 1: support CX20778 FW downloading to EEPROM
    #define SUPPORT_CNXT_FW_DOWNLOADING_RAM        (0)  // 1: support CX20778 FW downloading to SRAM directly
#else
    #define SUPPORT_CNXT_FW_DOWNLOADING_EEPROM     (0)
    #define SUPPORT_CNXT_FW_DOWNLOADING_RAM        (0)
#endif

#if (CUSTOMER == LIT)
    #define EMI_TEST                    (1)
    #define SUPPORT_EMI_TEST            (1)  // change sensor main clock from 144/6 MHz to 144/7 MHz
#else
    #define EMI_TEST                    (0)
    #define SUPPORT_EMI_TEST            (0)  // change sensor main clock from 144/6 MHz to 144/7 MHz
#endif
    
    #define ESD_RECOVERY                (0)  // ESD testing if sensor locked while video preview
    
    #define SUPPORT_WHQL_TEST           (0)  // To pass WHQL audio KS position item

    /** @name Customized GPIO **/
//Set 255 as undefined GPIO. Don't care about that pin basically.

//Set 1 or 2 to enable GPIO call-back features. Set 0 to reduce code size.
//0: not support  1: Support with one call-back 2: Could support call-back for each PIO
//#if (CUSTOMER == PNS)
    #define SUPPORT_GPIO_CALLBACK 1
//#else
//    #define SUPPORT_GPIO_CALLBACK 0 //Set 1 to enable GPIO callback features. Set 0 to reduce code size.
//#endif

#if ((AUDEXT_DAC == ADC3101) && SUPPORT_UAC)
    #define TI_RES         20  // BGPIO12
#endif
#if (CUSTOMER == PNS)
    #define SW_SIG         18  // BGPIO10 -> GPIO18
    #define S_DRIVE        19  // BGPIO11 -> GPIO19
    #define SEN_POW        21  // BGPIO13 -> GPIO21
    //#define SOLENOID_SWITCH        22   // BGPIO14 -> GPIO22
    #define LED_READY	   255
#elif (CUSTOMER == IPC) || (CUSTOMER == QDR) || (CUSTOMER == ANW)
    #if CHIP_AIT8451
    #define IR_LED         19  // BGPIO11 -> GPIO19
    #define ICR_SW         21  // BGPIO13 -> GPIO21
    #define SEN_PWR_EN     23  // BGPIO15 -> GPIO23
    #define VER_0          40  // CGPIO00 -> GPIO40
    #define VER_1          43  // CGPIO03 -> GPIO43
    //#define SEN_PWR_EN     45  // CGPIO5 -> GPIO45  // for TPV real board
    #define SEN_RST        07  // AGPIO07 -> GPIO07   //for AIT8451 IPCam
    #if (AUDEXT_DAC == CX20709)
    #define LED_READY      40  // CGPIO0 
    #define CNX_RST        44  // CGPIO4
    #endif
    #else
    #define SEN_PWR_EN     21  // BGPIO13 -> GPIO21
    #define SEN_RST        22  // BGPIO14 -> GPIO22   //for AIT8433 IPCam
    #endif
    //#define LED_READY	   255
#elif (CUSTOMER == NMG)
    #define CAM_EN         38  // CGPIO6
    #define AF_EN          40  // CGPIO8
    #define LED_READY      8   // BGPIO8 
    #define SNAP_PIN       15  // BGPIO15
    #define FLIP_PIN       18  // BGPIO18
    #define IRHID_PIN      39  // CGPIO7 for PCB v5
#elif (CUSTOMER == SAC)
    #define CAM_EN         7   // BGPIO7
    #define MOV_TRIG       32  // CGPIO0
    #define AF_EN          40  // CGPIO8
    #define LED_READY      10  // BGPIO10 
#elif (CUSTOMER == LIT)
    #define LED_READY      9   // BGPIO9
    #define CNX_RST        20  // BGPIO20
    #define MOV_TRIG       32  // CGPIO0
    #define SUSPEND_EN     34  // CGPIO2
    #define CNX_PWR_EN     35  // CGPIO3
    #define CAM_EN         40  // CGPIO8
#elif (CUSTOMER == NKT)
    #define LED_READY      9   // BGPIO9
    #define MOV_TRIG       7   // BGPIO7
    #define SUSPEND_EN     19  // BGPIO19
    #define AMP_CTRL       18  // BGPIO18
    #define CNX_PWR_EN     6   // BGPIO6
    #define CAM_EN         38  // CGPIO6
    #define AF_EN          40  // CGPIO8
    #define SWITCH         39  // CGPIO7
#elif ((CUSTOMER == LGT) && (MODEL == 0))
    #define LED_READY      5   // AGPIO5 
    #define WM_PWR_EN      45  // CGPIO5
    #define CAM_EN         7   // AGPIO7
#elif ((CUSTOMER == LGT) && (MODEL == 1))
    #define LED_READY      5   // AGPIO5 
    #define CNX_RST        44  // CGPIO4
    #define CNX_PWR_EN     45  // CGPIO5
    #define CAM_EN         7   // AGPIO7
#elif ((CUSTOMER == CCN) && (MODEL == 0))
    #define LED_READY      41  // CGPIO1 
    #define WM_PWR_EN      45  // CGPIO5
    #define CAM_EN         7   // AGPIO7
#elif (CUSTOMER == SNO)
    #define CAM_EN         21  // BGPIO13 -> GPIO21
    #define LED_READY      18  // BGPIO10 -> GPIO18 
#elif (CUSTOMER == LON)
    #define LED_READY      42  // CGPIO2 
    #define TORCH          43  // CGPIO3
    #define CAM_EN         7   // AGPIO7
#elif ((CUSTOMER == CCN) && (MODEL == 2))
    #define LED_READY      43  // CGPIO3 
    #define CAM_EN         7   // AGPIO7
#elif (CUSTOMER == ASU)
    #if MODEL == 0 //demo board
        #define LED_READY      19   // BGPIO11
        #define AF_EN          21   // BGPIO13
        #define CAM_EN_5M       6   // AGPIO6(PSEN)
        #define CAM_EN_1M       6   // AGPIO6(PSEN)
    #else // real_board
        #define LED_READY      19   // BGPIO11
        #define AF_EN          21   // BGPIO13
        #define CAM_EN_5M      25   //PI2S_WS (5M_PWDN)
        #define CAM_EN_1M      26   //PI2S_SDI (1M_PWDN)
        #define CAM_PWR_EN     24   //PI2S_SCK (SEN_PWR_EN)
    #endif
#else
    #define CAM_EN         6    // AGPIO6
    #define LED_READY      8    // 8423 
    #define AF_EN          18   // BGPIO10
    #define SNAP_PIN       255
#endif
    #ifndef AF_EN
        #define AF_EN	255
    #endif
    #ifndef SNAP_PIN
        #define SNAP_PIN 255
    #endif

    #define TEST_PIN1      8  // if no used, change to 255  
    #define TEST_PIN2      255  
    #define TEST_PIN3      255  
    //Truman@121107 move these options to customer.h since it won't be modified per project.
    /*
    #if (LED_READY!=255)
    #define LED_READY_PAD_CFG (PAD_E8_CURRENT | PAD_PULL_LOW)
    #endif
    #if (AF_EN!=255)
    #define AF_EN_PAD_CFG (PAD_E8_CURRENT | PAD_PULL_LOW)
    #endif
    #if (SNAP_PIN!=255)
    #define SNAP_PIN_PAD_CFG (PAD_E8_CURRENT | PAD_PULL_LOW)
    #endif
    #if (TEST_PIN1!=255)
    #define TEST_PIN1_PAD_CFG (PAD_E8_CURRENT | PAD_PULL_LOW)
    #endif
    #if (TEST_PIN2!=255)
    #define TEST_PIN1_PAD_CFG (PAD_E8_CURRENT | PAD_PULL_LOW)
    #endif
    #if (TEST_PIN3!=255)
    #define TEST_PIN1_PAD_CFG (PAD_E8_CURRENT | PAD_PULL_LOW)
    #endif

    #define GPIO_INT_H2L   (0)
    #define GPIO_INT_L2H   (1)
    */
	
    // This chip name should be defined in target later.
    #ifndef CHIP
        #define	CHIP	(VSN_V2)
    #endif

    /** @brief UART configuration

    Define which UART to use, and UART padset for output
    */
    #define DEBUG_UART_NUM (MMPF_UART_ID_0) //MMPF_UART_ID_0

    #if (CHIP == P_V2)||(CHIP == VSN_V2)
    #define DEBUG_UART_PIN (MMPF_UART_PADSET_2)		// 0: AGPIO0(TX), 1: PD8(TX), 2: BGPIO14(TX)
    #endif

    #define LED_ON    1 //set 1 for AIT GPIO high, 0 for AIT GPIO low.
    #define LED_OFF   0 //set 1 for AIT GPIO high, 0 for AIT GPIO low.
    /** end of Customized GPIO **/

    /** @name System Clock **/
    #if	(CHIP == P_V2)||(CHIP == VSN_V2)
    #define EXT_CLK 12000 //for 12 MHz 
    #endif
    //#define EXT_CLK 19200 //for 19.2 MHz 

    #define SUPPORT_CPU_CLOCK_SW    (1) //1: Support dynamically CPU clock freq switch
    #define SUPPORT_G0_CLOCK_SW     (1) //1: Support dynamically group 0 clock freq switch
    #define SUPPORT_DRAM_CLOCK_SW   (1) //1: Support dynamically DRAM clock freq switch
    #if (SUPPORT_G0_CLOCK_SW == 0)
        #ifdef SUPPORT_DRAM_CLOCK_SW
        #undef SUPPORT_DRAM_CLOCK_SW
        #define SUPPORT_DRAM_CLOCK_SW   (0)
        #endif
    #endif
    /** end of System Clock **/

    /** @name MMU Table address **/
    #if (CHIP == P_V2)||(CHIP == VSN_V2)
    #if DRAM_SIZE == 2
        #if CHIP_AIT8451
        #define MMU_TRANSLATION_TABLE_ADDR       (0x1800000-0x4000) //AIT8453:0x1800000
        #define MMU_COARSEPAGE_TABLE_ADDR        (0x1800000-0x4000+0x400)
        #else
        #define MMU_TRANSLATION_TABLE_ADDR       (0x1200000-0x4000) //AIT8433:0x1200000
        #define MMU_COARSEPAGE_TABLE_ADDR        (0x1200000-0x4000+0x400)
        #endif
        #define MAX_DRAM_BUF_ADDR                MMU_TRANSLATION_TABLE_ADDR//Max buffer address could be used for application in DRAM
    #else
        #define MMU_TRANSLATION_TABLE_ADDR         (0x12C000)//(0x19C000 - 0x4000)
        #define MMU_COARSEPAGE_TABLE_ADDR          (0x12C400)
    #endif
    
    #if DRAM_SIZE == 2
        #define SRAM_AREA_FOR_CRITICAL_REGION       (MMU_TRANSLATION_TABLE_ADDR)
        #define JPEG_LINE_BUF_LIMIT                 (MAX_DRAM_BUF_ADDR)
    #else
        #define SRAM_AREA_FOR_CRITICAL_REGION       (MMU_TRANSLATION_TABLE_ADDR - 0x4000)
    #endif
    
    #endif
    /** end of MMU Table address **/

    /** @name USB Clock **/
#if (CHIP == P_V2)||(CHIP == VSN_V2)
    #define	USB_CLKINPUT_CRYSTAL	(0)
    #define	USB_CLKINPUT_PLL		(1)
    #define	USB_CLKFREQ_12MHZ		(0)
    #define	USB_CLKFREQ_30MHZ		(1)

    #define	USB_CLK_INPUT 	USB_CLKINPUT_CRYSTAL
    #define	USB_CLK_FREQ  	USB_CLKFREQ_12MHZ

    #define USB_PHY_TEST_MODE_EN (1)
#endif
    /** end of USB Clock **/

    /** @name Sensor **/
#if (SUPPORT_DUAL_DEVICE) || (SUPPORT_SWITCH_CAMERA)
    #define TOTAL_SENSOR_NUMBER      2
#else
    #define TOTAL_SENSOR_NUMBER      1
#endif
    //SENSOR_ID is not needed. use BIND_SENSOR 1(main) & 2(second)
/*
    //#define SENSOR_ID_MT9D111        0
    //#define SENSOR_ID_OV7670         0 //Sample
    //#define SENSOR_ID_S5K4BAFB       0
    //#define SENSOR_ID_S5K5BAFX       0
    //#define SENSOR_ID_C2FKA244A      0
    //#define SENSOR_ID_IMX045ES       0
    //#define SENSOR_ID_IMX046TS       0
    //#define SENSOR_ID_TCM9001MD      1
*/

    #define BIND_SENSOR_MT9M011      0
    #define BIND_SENSOR_MT9M112      0
    #define BIND_SENSOR_MT9T013      0
    #define BIND_SENSOR_MT9T012      0
    #define BIND_SENSOR_MT9T111R3    0
    #define BIND_SENSOR_MT9D011      0
    #define BIND_SENSOR_MT9D111      0
    #define BIND_SENSOR_MT9P001      0
    #define BIND_SENSOR_MT9P012      0

    #define BIND_SENSOR_OV2650       0
    #define BIND_SENSOR_OV3642       0
    #define BIND_SENSOR_OV7660       0
    #define BIND_SENSOR_OV7670       0
    #define BIND_SENSOR_OV9650       0
    #define BIND_SENSOR_OV9653       0
    #define BIND_SENSOR_OV9655       0
    #define BIND_SENSOR_OV9660       0
    #define BIND_SENSOR_HV7131RP     0
    #define BIND_SENSOR_S5K3C1FX     0
    #define BIND_SENSOR_S5K4BAFB     0
    #define BIND_SENSOR_S5K5BAFX     0
    #define BIND_SENSOR_C2FKA244A    0
    #define BIND_SENSOR_GC0328       1
    //MIPI
    #define BIND_SENSOR_IMX045ES     0
    #define BIND_SENSOR_IMX046TS     0	
    #define BIND_SENSOR_MT9T002	     0	
    #define BIND_SENSOR_MT9P014      0
    #define BIND_SENSOR_MT9P111	     0	
    #define BIND_SENSOR_OV2710       0
    #define BIND_SENSOR_OV2722       0
    #define BIND_SENSOR_OV9710       0
    #define BIND_SENSOR_OV5647       0
    #define BIND_SENSOR_OV5650       0
    #define BIND_SENSOR_OV9726       0
    #define BIND_SENSOR_OV5680       0
    #define BIND_SENSOR_CG2355       0
    #define BIND_SENSOR_S5K4B2FX     0	
    #define BIND_SENSOR_S5K5B3GX     0
    #define BIND_SENSOR_S5K6A1GX     0	
    #define BIND_SENSOR_TCM9001MD    0
    #define BIND_SENSOR_AR0330       0
    #define BIND_SENSOR_AR0832E      0
    #define BIND_SENSOR_HM1375       0

    #define BIND_SENSOR_VENUS        0

    #define SENSOR_IF_PARALLEL       (0)
    #define SENSOR_IF_MIPI_1_LANE    (1)
    #define SENSOR_IF_MIPI_2_LANE    (2)
    #define SENSOR_IF_MIPI_4_LANE    (3)

#if ((CUSTOMER == NMG) && (BIND_SENSOR_OV2710)) || (BIND_SENSOR_OV9710) \
 || ((CUSTOMER == NKT) && (BIND_SENSOR_OV2710)) || (BIND_SENSOR_HM1375) \
 || ((CUSTOMER == SNO) && (MODEL==2)) \
 || ((CUSTOMER == SNO) && (MODEL==3)) \
 || ((CUSTOMER == ASU) && (MODEL==2)) \
 || (BIND_SENSOR_MT9D111) || (BIND_SENSOR_GC0328)
    #define SENSOR_IF                (SENSOR_IF_PARALLEL)
#elif (BIND_SENSOR_OV9726) || (BIND_SENSOR_OV2722)
    #define SENSOR_IF                (SENSOR_IF_MIPI_1_LANE)
#elif (BIND_SENSOR_OV5680) || (BIND_SENSOR_OV5650) || (BIND_SENSOR_OV5647) || (BIND_SENSOR_AR0330) || (BIND_SENSOR_AR0832E) || (BIND_SENSOR_CG2355)
    #define SENSOR_IF                (SENSOR_IF_MIPI_2_LANE)
#else
    #define SENSOR_IF                (SENSOR_IF_PARALLEL)
#endif    

    #define SUPPORT_DEFAULT_ZOOM        (0)    // For Skype FOV, 1920x1080 -> 1280x720

#if SUPPORT_DEFAULT_ZOOM
    #if ((CUSTOMER == LGT) && (BIND_SENSOR_OV2710))
    #define DEFAULT_ZOOM_STEP           (4)
    #elif ((CUSTOMER == LGT) && (BIND_SENSOR_S5K5B3GX))
    #define DEFAULT_ZOOM_STEP           (4)
    #else
    #define DEFAULT_ZOOM_STEP           (0)
    #endif
#endif

#if MotionDetection
    #if !(BIND_SENSOR_MT9D111||BIND_SENSOR_HM1375||BIND_SENSOR_AR0330||BIND_SENSOR_AR0832E||BIND_SENSOR_OV9710)
        #error Motion_detection_not_support.
    #endif
#endif

    // Flash LED definition
    #define BIND_FLASH_TPS61050     (0)
    #define BIND_FLASH_LM3554       (1)

    //Truman@121031 move to MTPT002 sensor files
    /*
    #define TEST_1152_648_MODE          (0)  // test only for MT9T002 3M sensor
    #define CROP_1080P_FROM_2304_1296   (0)  // test only for MT9T002 3M sensor
    #define ENABLE_ROW_BINNING_2304_648 (0)  // test only for MT9T002 3M sensor
    */

    #define FULLHD_VIDEO_ENCODE_MAX_FRAME_RATE  (15)
    #define LIMIT_SENSOR_MAX_FRAME_RATE         (30)

    #if (CHIP == P_V2)||(CHIP == VSN_V2)
    #if (BIND_SENSOR_S5K4BAFB)
    #define	SOFTWARE_I2CM
    #else
    #undef SOFTWARE_I2CM
    #endif	
    #endif	

    #if	defined(SOFTWARE_I2CM)
    #if (BIND_SENSOR_S5K4BAFB)
    #define I2C_DELAY           70
    #else
    #define I2C_DELAY           30
    #endif	
    #endif

    /** @brief Choose which initialization method to be used
    @note There should be new implementation for each customer.
    */
    /// @brief Sensor reset GPIO pin
    /*
    //Truman@121031 It seems to be replaced by SENSOR_IF_MIPI_4_LANE
    #define MIPI_LANE_CTL (0) // 0: Single lane 0, 1: Single lane 1, 2: Dual Lane.
    //#define SENSOR_SINGLE_LANE_0 0
    //#define SENSOR_SINGLE_LANE_1 0
    //#define SENSOR_DUAL_LANE 1
    */

    #if	(CHIP == P_V2)||(CHIP == VSN_V2)
    //#define GPIO_SENSOR_RST       //VIF pad RST for AIT 840 
    #endif
    #define GPIO_SENSOR_PSEN      6 // 6 for AIT8433(70 pin package)

    /** end of Sensor **/

    /** @name Video Recorder **/
    /** @brief Support landscape mode recording by rotate DMA.
	
    Instead of using LCD controller, frames for preview (in pipe 0) is rotated by rotate DMA.
    Presently it is only suitable for recording with large resolution (width>352),
    thus there will be distinct pipes for preview and encode.
    */
    #define MGR_PROC_EN         (0)
    #define H264_SW_CODING_EN   (0)
    #define MTS_MUXER_EN        (0)
    #define VIDEO_FPS_SCALE     (100)
    #define LANDSCAPE_SUPPORT   (1)
    #define DVS_EN              (0)
    //#define USE_TASK_DODVS      (0)
    #define VID_TIME_SYNC_ST    (1) // Turn on this, sync h264 timestamp to v-snc PTS
    #define SLOT_RING           (0)
    #define FORCE_BASELINE_SUB_BLK_EN   (0) // may have level violation in small resolution(<720x576)
    //#define MEASUER_TIMING      0
    #define H264E_RINGBUF       1
    #define SIMCAST_DROP        0
    #define SIMCAST_DROP_ID     1
    //#define MIN_H264E_COMP_RATIO        (8)
    #define INIT_I_FRAME_NUM    (2)     // Number of consecutive i frames at start,
                                        // for UVC driver may loss 1st frame issue
    #define KITE_ONLY_VIDEO_PATCH       (0)
    #define FLAG_EOF_IN_LAST_SLICE      1
    #if (FLAG_EOF_IN_LAST_SLICE == 1)
        #define H264_UVC_PH_FLAG_IDR        (0x00000001)
        #define H264_UVC_PH_FLAG_EOF        (0x00000002)
        #define H264_UVC_PH_FLAG_MD_TRG     (0x00000080)
        #define UVC_PH_EXT_BIT_SHIFT        (31)
        #define UVC_PH_EXT_BIT_MASK         (1<<UVC_PH_EXT_BIT_SHIFT)
    #endif
    //#define H264_MTS_SUPPORT 0
    
#if (CUSTOMER == NMG) || (CUSTOMER == NKT)
    #define USB_UVC_1080P_EN           (1)  // for 1080P H.264/YUY2 resolution
    #define USB_UVC_1080P_YUY2_EN      (1)  // for 1080P YUY2 resolution
    #define USB_UVC_1080P_MJPEG_EN     (1)  // for 1080P MJPEG resolution
    #define H264E_RINGBUF_SIZE  (800*1024)  // up to H.264 1080p
#elif (CUSTOMER == LON) || ((CUSTOMER == CCN) && (MODEL == 2)) || ((CUSTOMER == LGT) && (MODEL == 2)) || ((CUSTOMER == LGT) && (MODEL == 3))\
    || ((CUSTOMER == SNO)&&(MODEL == 2)) || ((CUSTOMER == ASU)&&(MODEL < 2)) 
    #define USB_UVC_1080P_EN           (0)  // for 1080P H.264/YUY2 resolution
    #define USB_UVC_1080P_YUY2_EN      (0)  // for 1080P YUY2 resolution
    #define USB_UVC_1080P_MJPEG_EN     (1)  // for 1080P MJPEG resolution
    #define H264E_RINGBUF_SIZE  (400*1024)  // up to H.264 1080p
#else
    #define USB_UVC_1080P_EN           (0)
    #define USB_UVC_1080P_YUY2_EN      (0)  // for 1080P YUY2 resolution
    #define USB_UVC_1080P_MJPEG_EN     (0)  // for 1080P MJPEG resolution
    #define H264E_RINGBUF_SIZE  (400*1024)  // up to H.264 720p
#endif

#if (CUSTOMER == LON) || ((CUSTOMER == CCN) && (MODEL == 2)) || ((CUSTOMER == LGT) && (MODEL == 2))\
    || ((CUSTOMER == LGT) && (MODEL == 3)) || ((CUSTOMER == ASU)&&(MODEL < 2))
    #define USB_UVC_5M_EN     (1)
#else
    #define USB_UVC_5M_EN     (0)
#endif

    #define SWAP_YUY2_PIPE    (0)
    #define SWAP_MJPG_PIPE    (0)

    #define FRAME_SIZE_NEW_PLAN  (1)
    #define VP_PLAN_SIZE  (0x4400)  //plan memory size for get video probe before YUV/MJPEG preview
                                    //if others has more memory plan, need to check this value
                                    //this value must less than your plan! (floor of MB)
                                    //0x2A00(ISP3~ISP14) + 0xC00(UVC1) + 0xC00(UVC2) + 0x400(1K reserved for alignment and header)
    /** end of Video Recorder **/

    /** @name storage **/
#if 0
    #define	FS_USE_UCS2			(0)
    #define SD_CARD_DETECT      (0)     // 1: enable card detect function, otherwise, don't use
    #define SD_WRITE_PROTECT    (0)     // 1: enable card write protect, otherwise, don't use
    #if (PROJECT == PRESTIGE||PROJECT == PURE)
    #define CARD_DET_PIN_NUM    (19)    // GPIO pin number
    #define SD_PWR_CTL          (1)     // 1: enable card power control, otherwise, don't use
    #define CARD_PWR_PIN_NUM    (7)     // GPIO pin number
    #define CARD_PWR_POLARITY   (0)     // card power enable polarity, 1: power enable high active
    #define SD_PIN_PAD_NUM      (0)
    #endif
    #if (PROJECT == STAGE)
    #define CARD_DET_PIN_NUM    (19)    // GPIO pin number
    #define SD_PWR_CTL          (1)     // 1: enable card power control, otherwise, don't use
    #define CARD_PWR_PIN_NUM    (24)    // GPIO pin number
    #define CARD_PWR_POLARITY   (0)     // card power enable polarity, 1: power enable high active
  	#define SD_PIN_PAD_NUM      (1)
    #endif
    #if (PROJECT == DEMOKIT)
    #define SD_PWR_CTL          (0)     // 1: enable card power control, otherwise, don't use
    #define CARD_DET_PIN_NUM    (6)     // GPIO pin number
    #define CARD_PWR_PIN_NUM    (7)     // GPIO pin number
    #define CARD_PWR_POLARITY   (0)     // card power enable polarity, 1: power enable high active
    #define SD_PIN_PAD_NUM      (0)
    #endif
    #define CARD_DET_POLARITY   (1)     // Card detect polarity, 1: pin value is high when card in
    #define CARD_WP_PIN_NUM     (7)     // GPIO pin number
    #define CARD_WP_POLARITY    (1)     // card write protect polarity, 1: pin value is high when write protect

    /* enable storage driver option */
    #define USING_SD_IF         (0)     // 1:enable SD driver
    #define USING_SM_IF         (0)     // 1:enable SM driver
    #define USING_MEMORY_IF     (0)     // 1:enable SM driver
    #define SM_2K_PAGE          (0)     // 0: 512bytes flash(64MB below), 1: 2k bytes flash(128MB above)
    // It doesn't need to modify below
    #if ((USING_SM_IF&&USING_SD_IF) ||(USING_MEMORY_IF&&USING_SD_IF))
    #define USING_DUAL_IF       (1)
    #define MSDC_LUN_NUMBER     (2)
    #else
    #define USING_DUAL_IF       (0)
    #define MSDC_LUN_NUMBER     (1)
    #endif
#endif
    #define MSDC_RX_EP2         (1)     // 1: TX ep1 and RX ep2. 
    /** end of storage **/

    /** @name MSDRM **/
    #define MSDRM_WMA           (0) // 0: Disable WMA with MS-DRM, 1: Enable WMA with MS-DRM
    #define MSDRM_MTP			(0) // 0: Disable MTP with MS-DRM, 1: Enable MTP with MS-DRM
    /** end of MSDRM **/

    /** @name USB **/
    #define USE_TASK_MODE_FOR_MSDC  (1)
    #define SYS_WD_ENABLE           (1) // 0: Disable CPU watch dog, 1: Enable
    #define SYS_SELF_SLEEP_ENABLE   (1) // 0: Disable System enter self-sleep (most power-saving) mode, 1: Enable
    #define SUPPORT_MSDC_FUNC   (0)
    #define SUPPORT_PCCAM_FUNC  (1) // 0: Disable PCCAM, 1: Enable PCCAM
    #define SUPPORT_MTP_FUNC    (0) // 0: Disable MTP, 1: Enable MTP
    #define SUPPORT_DPS_FUNC    (0) // 0: Disable DPS, 1: Enable DPS
    #define SUPPORT_UVC_FUNC    (1) // 0: Disable UVC, 1: Enable UVC !!!
    #define SUPPORT_PCSYNC_FUNC (0) // 0: Disable PCSync,1:Enable PCSync
#if (JTAG == 1)
    #define USB_SUSPEND_TEST    (0) // must be 0 for Linux  
#else
    #define USB_SUSPEND_TEST    (1) // must be 0 for Linux  
#endif

#if (CUSTOMER == NKT) || (CUSTOMER == SAC)// || (CUSTOMER == ANW)
    #define USB_UVC_BULK_EP     (1) // 0: ISO transfer, 1: Bulk transfer
#else
    #define USB_UVC_BULK_EP     (0) // 0: ISO transfer, 1: Bulk transfer
#endif    
    
    //#define USB_UVC_SKYPE       (1)   // 0 : AIT H264 format, 1 : Skype format. (YUY2 + H264)
    #define AIT_MODE_B_XU       (0)     // AIT EU1 CMD_13 customized XU setting. Set 1 for supporting AIT mode.
                                        // Set 0 will make EU1 CMD 13 unusable.
    //#define USB_SUSPEND_LOOP_IN_ITCM    (1)
    //#define DRAM_SELF_REFRESH         (0) //sean@2010_08_19
    #define USB_ENUM_AT_TASK_SUSPEND    (1) // Start USB enum after tasks are suspend.
    
    // ==== Supported UVC Formats ====
    #define USB_MJPEGH264_STREAM (0)    // Force MJPEG include H264. only effective when USB_UVC_H264 == 1
    // FIXME change the name later.
    #define SKYPE_UVC_H264       (1)    // for Skype UVC 1.1 H.264 Payload
    #define SECS_VER             (21)   // Skype Encoding Camera Specification version. Set 21 for 2.1 and 14 for 1.4
    #define SKYPE_H264_1080P     (0)    // support Skype 1080p H.264
    
    //#define USB_H264_USING_MOVEDMA  (0) //use UVC_MOVE_DMA_EN instead

    #define ENABLE_YUY2     1
    #define ENABLE_MJPEG    0//1
    #define MFPS                       (1)  //number of FPS in UVC descriptor, set 1 for one FPS only
    #define SWAP_VIDEO_FORMAT_INDEX    (0)  // Set 0 to keep original video format index: YUY2 is 1, MJPEG is 2
                                            // Set 1 to swap the video format index: MJPEG is 1 and YUY2 is 2

	//Only one of the following USB_FRAMEBASE_* could be enabled.
#if (CUSTOMER == NKT) || (CUSTOMER == LIT) || (CUSTOMER == SAC) || (CUSTOMER == LGT) || (CUSTOMER == SNO) || (CUSTOMER == PNS) || (CUSTOMER == QDR) || (CUSTOMER == IPC) || (CUSTOMER == ANW)
    #define USB_FRAMEBASE_H264_ONLY (1)//Frame Base H264
#else
    #define USB_FRAMEBASE_H264_ONLY (0)//Frame Base H.264
#endif

#if (CUSTOMER == LIT)
    #define USB_FRAMEBASE_H264_YUY2_STREAM     (1) // Frame Base H.264 with YUY2 stream
#else
    #define USB_FRAMEBASE_H264_YUY2_STREAM     (0) // Frame Base H.264 with YUY2 stream
#endif

    #define USB_FRAMEBASE_H264_MJPEG_STREAM    (1)  // Frame Base H.264 with MJPEG stream

#if (CHIP_AIT8451 == 0)  // AIT8433 can't support Dual H.264 or Frame H.264+MJPG
    #define USB_FRAMEBASE_DUAL_H264_STREAM     (0)  // Frame Base Dual H.264 stream
#else
    #define USB_FRAMEBASE_DUAL_H264_STREAM     (1)  // Frame Base Dual H.264 stream
#endif    

    //#define SIGMA_DELTA_TRACKING      (1)

    #define XU_FRAMEBASE_CAPTURE        (1) // YUY2/MJPG/H264 change to FRAMEBASE(YUY2/MJPG/H264) for capture mode on Linux
    #define USING_STILL_METHOD_1        (0) // 0: using still method 2, 1: using still method 1
    //#define USB_EP0_SETUP_DEBUG_ENABLE  (0)  // 1: enable USB EP0 Setup command printf debug message
    // ==== end of Supported UVC Formats ====
	
#if 0//(CHIP_AIT8451 == 1)
    #define SUPPORT_OSD_FUNC            (1) // AIT8451 can support OSD
#else
    #define SUPPORT_OSD_FUNC            (0) // AIT8433 can't support OSD
#endif

    #if SUPPORT_OSD_FUNC
    #define ENABLE_RTC_ON_AIT           (0)
    #define RES_OSD_H24_FONT            (1)

    #define USE_HW_TIMER_TRIGGER        (0)
    #define USE_SW_TIMER_TRIGGER        (1)
    #define MAINTAIN_RTC_TIME_METHOD    (USE_HW_TIMER_TRIGGER)
    
    #define MOVE_OSD_USING_DMA          (1)
#if (CUSTOMER == ANW)    
    #define OSD_DISPLAY_ON_UP_RIGHT     (1)  // Display OSD on up-right corner
#else
    #define OSD_DISPLAY_ON_UP_RIGHT     (0)  // Display OSD on up-left corner
#endif    

    #define OSD_HEIGHT_MAX_LINE         (2)                     

    // YUV color
    #define OSD_COLOR_BLACK_Y           (0x00)
    #define OSD_COLOR_BLACK_UV          (0x8080)
    #define OSD_COLOR_WHITE_Y           (0xFF)
    #define OSD_COLOR_WHITE_UV          (0x8080)
    
    // RGB color
    #define OSD_COLOR_BLACK_R           (0x00)
    #define OSD_COLOR_BLACK_G           (0x00)
    #define OSD_COLOR_BLACK_B           (0x00)
    #define OSD_COLOR_WHITE_R           (0xFF)
    #define OSD_COLOR_WHITE_G           (0xFF)
    #define OSD_COLOR_WHITE_B           (0xFF)
    #define OSD_COLOR_BLUE_R            (0x00)
    #define OSD_COLOR_BLUE_G            (0x00)
    #define OSD_COLOR_BLUE_B            (0xFF)
    #define OSD_COLOR_YELLOW_R          (0xFF)
    #define OSD_COLOR_YELLOW_G          (0xFF)
    #define OSD_COLOR_YELLOW_B          (0x00)
    #define OSD_COLOR_RED_R             (0xFF)
    #define OSD_COLOR_RED_G             (0x00)
    #define OSD_COLOR_RED_B             (0x00)
    #define OSD_COLOR_ORANGE_R          (0xFF)
    #define OSD_COLOR_ORANGE_G          (0xA5)
    #define OSD_COLOR_ORANGE_B          (0x00)
    #define OSD_COLOR_CYAN_R            (0x00)
    #define OSD_COLOR_CYAN_G            (0xFF)
    #define OSD_COLOR_CYAN_B            (0xFF)
    #define OSD_COLOR_GOLD_R            (0xFF)
    #define OSD_COLOR_GOLD_G            (0xD7)
    #define OSD_COLOR_GOLD_B            (0x00)
    
    #define OSD_FOREGROUND_COLOR_R      (OSD_COLOR_WHITE_R)
    #define OSD_FOREGROUND_COLOR_G      (OSD_COLOR_WHITE_G)
    #define OSD_FOREGROUND_COLOR_B      (OSD_COLOR_WHITE_B)
    #define OSD_BACKGROUND_COLOR_R      (OSD_COLOR_BLUE_R)
    #define OSD_BACKGROUND_COLOR_G      (OSD_COLOR_BLUE_G)
    #define OSD_BACKGROUND_COLOR_B      (OSD_COLOR_BLUE_B)
    
#else

    #define MOVE_OSD_USING_DMA          (0)
        
#endif

#if (CUSTOMER == ANW)
    #define MJPG_FPS_CTL                 (0)
#else
    #define MJPG_FPS_CTL                 (1)
#endif

#define SUPPORT_MTS (0)
#if (CUSTOMER == ANW)	
//#define SUPPORT_MP4 (1) //Output H.264 + AAC bitstream.  Container is made by the host.
#define SUPPORT_MP4 (0) //Output H.264 + AAC bitstream.  Container is made by the host.
#else
#define SUPPORT_MP4 (0) //Output H.264 + AAC bitstream.  Container is made by the host.
#endif

/* UVC_IT_BITMAP (CT) []:supported features
 * D23~D20: 0, 0, [ROI], [Window],
 * D19~D16: Focus(Simple), Privacy, [Focus(Auto)], 0
 * D15~D12: 0, Roll (Relative), [Roll (Absolute)], PanTilt (Relative)
 * D11~ D8: [PanTilt (Absolute)], Zoom (Relative), [Zoom (Absolute)], Iris (Relative)
 * D7 ~ D4: [Iris (Absolute)], Focus (Relative), [Focus (Absolute)], Exposure Time (Relative)
 * D3 ~ D0: [Exposure Time (Absolute)], [Auto-Exposure Priority], [Auto-Exposure Mode], Scanning Mode*/
/* UVC_PU_BITMAP []:supported features
 * D17~D16: Analog Video Lock Status, Analog Video Standard
 * D15~D12: Digital Multiplier Limit, Digital Multiplier, [White Balance Component(Auto)], [White Balance Temperature(Auto)]
 * D11~ D8: [Hue(Auto)], [Power Line Frequency], [Gain], [Backlight Compensation]
 * D7 ~ D4: White Balance Component, [White Balance Temperature], [Gamma], [Sharpness]
 * D3 ~ D0: [Saturation], [Hue], [Contrast], [Brightness] */
#if (CUSTOMER == ASU)
    #define UVC_D1_IT_BITMAP        (0x000A0A)
    #define UVC_D1_PU_BITMAP        (0x0157F)
#elif (CUSTOMER == PNS) || (CUSTOMER == IPC) || (CUSTOMER == QDR) || (CUSTOMER == ANW)
    #define UVC_D1_IT_BITMAP        (0x000A0A)
    #define UVC_D1_PU_BITMAP        (0x0177F)
#else
    #if SUPPORT_AUTO_FOCUS
        #define UVC_D1_IT_BITMAP    (0x020A2A)   // AE
        #define UVC_D1_PU_BITMAP    (0x0157F)    // gain
    #else
        #define UVC_D1_IT_BITMAP    (0x000A0A)   // AE
        #define UVC_D1_PU_BITMAP    (0x0157F)    // gain
    #endif
#endif

#if (SUPPORT_DUAL_DEVICE || SUPPORT_SWITCH_CAMERA)
    #define UVC_D2_IT_BITMAP  (0x223A2A)    // AE //add window and ROI
    #define UVC_D2_PU_BITMAP  (0x0157F)     // gain
#else
    #define UVC_D2_IT_BITMAP (0x000000)
    #define UVC_D2_PU_BITMAP (0x0)
#endif

#if (CUSTOMER == LIT) || (CUSTOMER == LGT) 
    #define NUM_OF_UAC_SAMPLING_RATE                         (0x01)
#elif ((CUSTOMER == CCN)&&(MODEL == 1))
    #define NUM_OF_UAC_SAMPLING_RATE                         (0x02)
#elif ((CUSTOMER == CCN)&&(MODEL == 0))// || (CUSTOMER == SNO)
    #define NUM_OF_UAC_SAMPLING_RATE                         (0x02)
#elif (CUSTOMER == ANW)
    #define NUM_OF_UAC_SAMPLING_RATE                         (0x02)
#else
    #define NUM_OF_UAC_SAMPLING_RATE                         (0x01)
#endif

#if (SUPPORT_DUAL_DEVICE == 1)
    #define BLOCK_2_UVC_INTERFACE       (1)//block 2 UVC interface PROBE/COMMIT simultaneously
#else
    #define BLOCK_2_UVC_INTERFACE       (0)
#endif
    /** end of USB **/

    /** @name DSC **/
    #define FDTC_SUPPORT        (0) // 1: Enable face detection, 0:Disable face detection
    /*
    //#define EXIF_CARD_MODE_ENC 	(1) // 1: Support card mode EXIF encode, 0: Disable card mode EXIF encode
    //#define EXIF_CARD_MODE_DEC 	(0) // 1: Support card mode EXIF decode, 0: Disable card mode EXIF decode
    //#define EXIF_MAKER_CUS     "AIT Electronics Inc"
    //#define EXIF_MODEL_CUS     "AIT-840D"
    //#define EXIF_SOFTWARE_CUS  "AIT Corp"
    //#define EXIF_ARTIST_CUS    "AIT Corp"
    //#define EXIF_COPYRIGHT_CUS "AIT Corp"
     */
    #define USE_TASK_DO3A       (1)

    /*
    //#define SCALE_DNSAMP_2_MODE       (0) // 1: Enable scaler down sample 2 mode
    //#define DSC_JPEG_DEBUG_FOR_ISP    (0) //1: Write ISP register setting to JPEG file
     */

    #define DSC_GRAB_CENTER     (0)
    #define DSC_SCALE_GRAB_IN_RAW_EN       (0)

    #define SUPPORT_PIPE_G 1

#if (CUSTOMER == ASU)
    #define	PCCAM_DEFAULT_QF		(0x0010) //default q-factor (Usb High Speed), ASU serious quality
    #define SUPPORT_METHOD_1_MJPEG_CAPTURE_EXIF	(0) //EXIF in METHOD_1 for ASU
#else
    #define	PCCAM_DEFAULT_QF		(0x0016)
    #define SUPPORT_METHOD_1_MJPEG_CAPTURE_EXIF	(0)
#endif
    /** end of DSC **/

    /** @name AUDIO **/
    #if (CHIP == P_V2)||(CHIP == VSN_V2)
    #define	DEFAULT_DAC_DIGITAL_GAIN 		0x3F //per channel
    #define	DEFAULT_DAC_ANALOG_GAIN  		0xAA
    #define DEFAULT_DAC_LINEOUT_GAIN        0xCC
    #define	DEFAULT_ADC_DIGITAL_GAIN 		0x3F //per channel
    #define	DEFAULT_ADC_ANALOG_GAIN  		0x77 //20db
    #endif
    /*
    #define MP3_LOW_POWER_EN    (0)
    #define MP3_POWER_SAVING_EN	(0)
    */
    #define AUDIO_DEC_ENC_SHARE_WB	(1)
    #define OMA_DRM_EN          (0)
    #define	NOISE_REDUCTION_EN  (0)
    #define EXT_CODEC_SUPPORT   (1)

    #define SBC_SUPPORT	        (0) // 0: Disable SBC encode, 1: Enable SBC encode
    #define SRC_SUPPORT	        (0) // 0: Disable SRC encode, 1: Enable SRC encode
    #define WAV_ENC_SUPPORT     (0)
    #define AUDIO_STREAMING_EN	(0)
    /*
    #define AUDIO_MIXER_EN		(0) // 0: Disable software mixer 1: Enable software mixer
    #define PCM_TO_DNSE_EN		(0) // 0: Disable software mixer 1: Enable software mixer
    */
    #define PCM_ENC_SUPPORT     (0)
    #define GAPLESS_EN          (0) // 0: Disable gapless playback, 1: Enable gapless playback
    #define LGE_OAEP_EN         (0)
    /** end of AUDIO **/
    
    /** @name H264 **/
    /*
    //#define H264_DEC_SUPPORT      (0)	// mark by tomy
    //#define MP4ASP_DEC_SUPPORT    (0)
    //#define H264_SPS_PPS_INSERT_BEFORE_IDR_FRAME  (1)
    //#define H264_IME_NUM          (0)
    */
    #define LAYER_ID_BIT_SHIFT_TEMPORAL     (16)
    /** end of H264 **/
    //
    // H264 setting using the values after commit
    //
    #define USING_UVCX_VIDEO_CONFIG (1)
    
    /** @name APP **/
    #if (CHIP == P_V2)||(CHIP == VSN_V2)
    #define ARCSOFT_APP_EN      (0) // 0: Disable Arcsoft applications, 1: Enable Arcsoft applications
    #define ARCSOFT_FDTC_EN     (0) // 0: Disable Arcsoft face detection, 1: Enable Arcsoft face detection
    #define ARCSOFT_SDTC_EN     (0) // 0: Disable Arcsoft smile detection, 1: Enable Arcsoft smile detection
    #endif
    /** end of APP **/
    
 //   #if (FDTC_SUPPORT == 1)
 //       #define DYNAMIC_CONFIG_CACHEBUF (1)
//    #else
//        #define DYNAMIC_CONFIG_CACHEBUF (0)
//    #endif

#if defined(ALL_FW)  // This part can be changed by difference project.
    #define FS_EN  0
    #define DSC_R_EN 0
    #define DSC_P_EN 0
    #define AAC_P_EN 0//1
    #define MP3_P_EN 0//1
    #define AAC_R_EN 0//1
    #define MP3_R_EN 0//1
    #define AMR_R_EN 0
    #define AMR_P_EN 0//1
    #define MIDI_EN 0//1
    #define WMA_EN 0
    #define AC3_P_EN 0//1
    #define VAMR_R_EN 0//1
    #define VAMR_P_EN 0//1
    #define VAAC_R_EN 1
    #define VAAC_P_EN 0//1
    #define VAC3_P_EN 0//1	
    #define USB_EN 1
    #define OGG_EN 0//1
    #define WMAPRO10_EN 0//1
    #define RA_EN 0//1
    #define RV_EN 0
    #define VRA_P_EN 0
    #define WAV_P_EN 0//1
    #define VMP3_P_EN 0//1	
    #define MP3HD_P_EN 0
    #define WAV_R_EN 0
    #define VMP3_P_EN 0	
    #define VWAV_P_EN 0
    #define WMV_P_EN 0
    #define VWMA_P_EN 0
    #define FLAC_P_EN 0
	
    #define PCAM_EN ((USB_EN) && (SUPPORT_UVC_FUNC))
	
    #define AUDIO_EFFECT_EN     (0)
	
    #if (DSC_R_EN)||(VAMR_R_EN)||(VAAC_R_EN)
        #define SENSOR_EN  1
    #else
        #define SENSOR_EN  0
    #endif
    #if (AAC_P_EN)||(MP3_P_EN)||(MP3HD_P_EN)||(AMR_P_EN)||(MIDI_EN)||(WMA_EN)||(OGG_EN)||(WMAPRO10_EN)||(RA_EN)||(WAV_P_EN)
        #define AUDIO_P_EN 1 // Use for some common audio play usage. 
        #define ENABLE_AUD_P_FEATURE	1
    #else
        #define AUDIO_P_EN 0
        #define ENABLE_AUD_P_FEATURE	0
    #endif
    #if (AMR_R_EN)||(MP3_R_EN)||(AAC_R_EN)||(WAV_R_EN)
        #define AUDIO_R_EN 1 // Use for some common audio record usage. 
    #else
        #define AUDIO_R_EN 0 
    #endif
    #if (AAC_R_EN)||(VAAC_R_EN)
        #if (SUPPORT_MP4) || (SUPPORT_MTS)
        #define AUDIO_AAC_R_EN 1 // Use for some common audio AAC record usage. 
        #else
        #define AUDIO_AAC_R_EN 0 
        #endif
    #else
        #define AUDIO_AAC_R_EN 0 
    #endif
    #if (AAC_P_EN)||(VAAC_P_EN)
        #define AUDIO_AAC_P_EN 1 // Use for some common audio AAC play usage. 
    #else
        #define AUDIO_AAC_P_EN 0 
    #endif	
    #if (MP3_P_EN)||(VMP3_P_EN)
        #define AUDIO_MP3_P_EN 1 	
    #else
        #define AUDIO_MP3_P_EN 0 
    #endif	
    #if (AC3_P_EN)||(VAC3_P_EN)
        #define AUDIO_AC3_P_EN 1
    #else 	
        #define AUDIO_AC3_P_EN 0
    #endif
    #if (AMR_R_EN)||(VAMR_R_EN)
        #define AUDIO_AMR_R_EN 1 // Use for some common audio AMR record usage. 
    #else
        #define AUDIO_AMR_R_EN 0 
    #endif
    #if (AMR_P_EN)||(VAMR_P_EN)
        #define AUDIO_AMR_P_EN 1 // Use for some common audio AMR play usage. 
    #else
        #define AUDIO_AMR_P_EN 0 
    #endif	
    #if (VAMR_R_EN)||(VAAC_R_EN)
        #define VIDEO_R_EN 1 // Use for some common video record usage. 
    #else
        #define VIDEO_R_EN 0 
    #endif	
    #if (VAMR_P_EN)||(VAAC_P_EN)||(VMP3_P_EN)
        #define VIDEO_P_EN 1 // Use for some common video play usage. 
    #else
        #define VIDEO_P_EN 0 
    #endif	
    #if (VAMR_P_EN)||(VAAC_P_EN)||(DSC_P_EN)||(DSC_R_EN)||(VAAC_R_EN)||(VAMR_R_EN)
        #define TV_EN 0 // Use for some common tv function usage. 
    #else
        #define TV_EN 0 
    #endif				
    #if (ARCSOFT_APP_EN)
        #define APP_EN 1
    #else
        #define APP_EN 0
    #endif

#endif	

#if defined(UPDATER_FW)
    #ifdef PMP_USE_MUON
        #undef PMP_USE_MUON
        #define PMP_USE_MUON        0
        #undef USE_MUON_MEMMGR
        #define USE_MUON_MEMMGR     0
    #endif
    
    #ifdef FS_LIB
        #undef FS_LIB
        #define FS_LIB   FS_UFS
        #undef FS_UCS2_TO_UTF8
        #define	FS_UCS2_TO_UTF8     (1)
    #endif

    #ifdef MMPF_PMP_S_USED
        #undef MMPF_PMP_S_USED
        #define MMPF_PMP_S_USED     0
    #endif
    
    #ifdef SUPPORT_MTP_FUNC
        #undef SUPPORT_MTP_FUNC
        #define SUPPORT_MTP_FUNC    0
    #endif

    #ifdef USB_EN
        #undef USB_EN
        #define USB_EN    1
    #else
        #define USB_EN    1
    #endif
#endif

#if defined(MBOOT_FW)
    #ifdef PMP_USE_MUON
        #undef PMP_USE_MUON
        #define PMP_USE_MUON        0
        #undef USE_MUON_MEMMGR
        #define USE_MUON_MEMMGR     0
    #endif

    #ifdef MULTI_FS
        #undef MULTI_FS
        #define MULTI_FS    0
    #endif
    
    #ifdef MMPF_PMP_S_USED
        #undef MMPF_PMP_S_USED
        #define MMPF_PMP_S_USED     0
    #endif
    
    #ifdef SUPPORT_MTP_FUNC
    	#undef SUPPORT_MTP_FUNC
    	#define SUPPORT_MTP_FUNC    0
    #endif

    #ifdef USB_EN
    	#undef USB_EN
    	#define USB_EN  0
    #else
    	#define USB_EN  0
    #endif

    #ifdef TV_EN
    	#undef TV_EN
    	#define TV_EN   0
    #else
    	#define TV_EN   0
    #endif
   
#endif


///ISP setting=========================
#define IQ_OPR_DMA_ON			1

#if (DRAM_SIZE > 2) //8433 does not need these
#if (CHIP == P_V2)
#define ISP_AWB_BUF_SIZE    (5*1024)
#define ISP_AE_BUF_SIZE     (1024)
#define ISP_AF_BUF_SIZE     (1024)
#define ISP_DFT_BUF_SIZE    (1024)
#define ISP_HIST_BUF_SIZE   (0)
#define ISP_FLICK_BUF_SIZE  (0)
#endif
#if (CHIP == VSN_V2)
#define ISP_AWB_BUF_SIZE    (5*1024)
#define ISP_AE_BUF_SIZE     (0)
#define ISP_AF_BUF_SIZE     (0)
#define ISP_DFT_BUF_SIZE    (0)
#define ISP_HIST_BUF_SIZE   (128*4)
#define ISP_FLICK_BUF_SIZE  (0)
#endif
#if (CHIP == VSN_V3)
#define ISP_AWB_BUF_SIZE    (5*1024)
#define ISP_AE_BUF_SIZE     (1024)
#define ISP_AF_BUF_SIZE     (0)
#define ISP_DFT_BUF_SIZE    (0)
#define ISP_HIST_BUF_SIZE   (128*4)
#define ISP_FLICK_BUF_SIZE  (0)
#endif

#if (IQ_OPR_DMA_ON == 1)
    #define IQ_BANK_SIZE        (256*16)
    #define LS_BANK_SIZE        (256*(3+1)*2*2)
    #define CS_BANK_SIZE        (42*32*3*2*2)
#else
    #define IQ_BANK_SIZE        (0)
    #define LS_BANK_SIZE        (0)
    #define CS_BANK_SIZE        (0)
#endif

#if IQ_OPR_DMA_ON
#define IQ_BANK_ADDR		(((m_glISPBufferStartAddr+ISP_AWB_BUF_SIZE+ISP_AE_BUF_SIZE+ISP_AF_BUF_SIZE+ISP_DFT_BUF_SIZE+ISP_HIST_BUF_SIZE+ISP_FLICK_BUF_SIZE+256) >> 8 << 8));
#define LS_BANK_ADDR		(((m_glISPBufferStartAddr+ISP_AWB_BUF_SIZE+ISP_AE_BUF_SIZE+ISP_AF_BUF_SIZE+ISP_DFT_BUF_SIZE+ISP_HIST_BUF_SIZE+ISP_FLICK_BUF_SIZE+256) >> 8 << 8)+IQ_BANK_SIZE);
#define CS_BANK_ADDR		(((m_glISPBufferStartAddr+ISP_AWB_BUF_SIZE+ISP_AE_BUF_SIZE+ISP_AF_BUF_SIZE+ISP_DFT_BUF_SIZE+ISP_HIST_BUF_SIZE+ISP_FLICK_BUF_SIZE+256) >> 8 << 8)+IQ_BANK_SIZE+LS_BANK_SIZE);
#else
#define IQ_BANK_ADDR		(0x80000000)
#define LS_BANK_ADDR		(0x80000000)
#define CS_BANK_ADDR		(0x80000000)
#endif

#define IQ_OPR_DMA_SIZE     (IQ_BANK_SIZE+LS_BANK_SIZE+CS_BANK_SIZE+256) //256 alignment
#define ISP_BUFFER_SIZE     (ISP_AE_BUF_SIZE+ISP_AF_BUF_SIZE+ISP_AWB_BUF_SIZE+ISP_DFT_BUF_SIZE+ISP_HIST_BUF_SIZE+ISP_FLICK_BUF_SIZE+IQ_OPR_DMA_SIZE)
#endif
#endif
//@end_ait_only
